<?php

namespace App\Services;

use App\Models\Cms_Staff;

class StaffService
{
    public function getStaffList($params)
    {
        $list = Cms_Staff::getFilter($params)
            ->Nodel()
            ->orderBy('id','desc')
            ->get();
//        $arr = [];
//        foreach ($list as $key => $val){
//            $arr[$key] = ['label' => $val->nickname,'value' => $val->id];
//        }
        return $list;
    }

    public function getList($params)
    {
        $result = Cms_Staff::getFilter($params)
            ->Nodel()
            ->orderBy('id','desc')
            ->paginate($params['pageSize']);
        $list['list'] = $result->items();
        $list['total'] = $result->total();
        return $list;
    }
}
